package com.sjy.common.constant;

import java.io.Serializable;

import com.sjy.common.entity.SecuryUserDetail;



/***
 * 用户上下文
 * @author marcle
 *
 */
public class UserContext implements Serializable {
 
    /** 
     * @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么) 
     */
 
    private static final long serialVersionUID = 1L;
 
    private static ThreadLocal<SecuryUserDetail> loginEntityThreadLocal = new ThreadLocal<SecuryUserDetail>();
 
    public static SecuryUserDetail getUserSession() {
        return loginEntityThreadLocal.get();
    }
 
    public static void setUserSession(SecuryUserDetail entity) {
        loginEntityThreadLocal.set(entity);
    }
 
    public static void removeUserSession() {
        loginEntityThreadLocal.remove();
    }
}
